#ifndef ABSTRACTPROVIDER_H
#define ABSTRACTPROVIDER_H

#include <QObject>
#include <QHash>
class QNetworkAccessManager;
class QNetworkCookieJar;

class AbstractProvider : public QObject
{
Q_OBJECT
public:
    enum AuthResult {AuthSuccess, AuthError, NetworkError, CabinetError, Unknown};

    AbstractProvider(QObject *parent = 0);
    virtual void setData(const QHash<QString, QString>&) = 0;
    virtual void authorize() = 0;
    virtual void requestData() = 0;
    //virtual AuthResult getStatus() = 0;

protected:
    QNetworkAccessManager *manager;
    QNetworkCookieJar *cookieJar;

signals:
    void status(AbstractProvider::AuthResult);
    void information(QHash<QString, QString>);
};

#endif // ABSTRACTPROVIDER_H
